package com.gxa.web_admin.controller;

import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.R;
import com.gxa.modules.service.IndiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@RestController
@RequestMapping("/indi")
public class IndiDriverController {
    @Autowired
    private IndiService indiService;

    /**
     * 查询车辆列表和条件查询
     * @param map
     * @return
     */
    @PostMapping("/findIndiDriver")
    public JsonResult findIndiDriver(@RequestBody HashMap map){
        return indiService.findIndiDriver(map);
    }

    /**
     * 添加车辆
     * @param map
     * @return
     */
    @PostMapping("/addIndiDriver")
    public R addIndiDriver(@RequestBody HashMap map){
        return indiService.addIndiDriver(map);
    }

    @GetMapping("/findIndiDriverById")
    public R findIndiDriverById(Integer indi_id){
        return indiService.findIndiDriverById(indi_id);
    }

    /**
     * 编辑
     * @param map
     * @return
     */
    @PostMapping("/updateIndiDriver")
    public R updateIndiDriver(@RequestBody HashMap map){
        return indiService.updateIndiDriver(map);
    }

    @GetMapping("/delIndiDriver")
    public R delIndiDriver(Integer indi_id){
        return indiService.delIndiDriver(indi_id);
    }

}
